<script setup lang="ts">
import BaseWindow from "../../base-window/index.vue";
import img0 from "../../../assets/images/guangzhao.png";
import img1 from "../../../assets/images/bkg-1.png";
import img2 from "../../../assets/images/bkg-2.png";
import img3 from "../../../assets/images/bkg-3.png";
import img4 from "../../../assets/images/bkg-4.png";
import img5 from "../../../assets/images/bkg-5.png";
import { ref } from "vue";
const tables = ref([
  {
    label: "光照强度",
    value: "26",
    bkg: img0,
    color: "#DC8F22",
  },
  {
    label: "空气温度",
    value: "26",
    bkg: img1,
    color: "#13E04E",
  },
  {
    label: "空气湿度",
    value: "26",
    bkg: img2,
    color: "#0CB7FB",
  },
  {
    label: "CO2浓度",
    value: "26",
    bkg: img3,
    color: "#9631F8",
  },
  {
    label: "土壤湿度",
    value: "26",
    bkg: img4,
    color: "#41E6F3",
  },
  {
    label: "土壤PH值",
    value: "26",
    bkg: img5,
    color: "#0CB7FB",
  },
]);
</script>

<template>
  <BaseWindow title="种植室">
    <div class="row-wrapper">
      <template v-for="item in tables">
        <div class="row" :style="{ backgroundImage: `url(${item.bkg})` }">
          <div
            class="item-value"
            :style="{
              background: `linear-gradient(180deg, #ffffff 0%, ${item.color} 100%)`,
            }"
          >
            {{ item.value }}
          </div>
          <div class="item-label">
            {{ item.label }}
          </div>
        </div>
      </template>
    </div>
  </BaseWindow>
</template>

<style lang="scss" scoped>
.row-wrapper {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  width: 430px;
}
.row {
  display: flex;
  align-items: center;
  margin-top: 10px;
  padding: 0 15px;
  box-sizing: border-box;
  font-size: 20px;
  font-weight: 400;
  width: 193px;
  margin-bottom: 10px;
  height: 69px;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  padding-left: 54px;
  .item-label {
    font-size: 18px;
    opactiy: 0.8;
    position: relative;
    top: -8px;
    font-weight: 300;
  }
  .item-value {
    font-size: 24px;
    font-weight: bold;
    color: #ffffff;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent;
  }
}
</style>
